<?php

namespace Danmu;

use \Qiniu\Auth;

class qiniu
{

    protected $auth = null;

    public static $host = 'http://image.ldqsdy.com/';

    public function __construct()
    {
        $accessKey = "VNS99znpYpO-bC5BfD6LUWndPZiLj0tOcvYlr0-F";
        $secretKey = "UDZOY_qMbwrrGnPQb3XEyFxdwcvHDYFVJG4TOuoS";
        // 初始化Auth状态
        $this->auth = new Auth($accessKey, $secretKey);
    }

    public function getToken()
    {
        $bucket = "helloweb";
        $expires = 3600;
        $policy = null;
        $upToken = $this->auth->uploadToken($bucket, null, $expires, $policy, true);
        return $upToken;
    }

}
